package io.github.wanggit.antrpc.client.zk.lb;

import io.github.wanggit.antrpc.client.zk.zknode.NodeHostEntity;
import io.github.wanggit.antrpc.commons.bean.SubscribeNode;
import io.github.wanggit.antrpc.commons.lb.LoadBalancerDTO;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface ILoadBalancerContainer {

    HashMap<String, ILoadBalancer> loadBalancersSnapshot();

    void addLoadBalancer(LoadBalancerDTO loadBalancerDTO);

    void updateLoadBalancer(LoadBalancerDTO loadBalancerDTO);

    void deleteLoadBalancer(String interfaceName);

    void addHost(String classMethodFullName, NodeHostEntity host);

    void updateHost(String classMethodFullName, NodeHostEntity host);

    void deleteHost(String classMethodFullName, NodeHostEntity host);

    ILoadBalancer getLoadBalancer(String classMethodFullName);

    Map<String, List<NodeHostEntity>> getAllNodeHostEntities();

    void updateHostRateLimit(SubscribeNode subscribeNode);
}
